#include "town.h"

int gNumOfMonsters = 0; // Used by player.cpp but need in other areas

bool gIsGameOver = false; // Goes back to main menu
bool gIsCharacterMade = false; // new game checking and basic logic stuff

bool gInMainMenu = false;
bool gInTown = false; // Buy weapons, armor, magic, poison, potions here
bool gInBoat = false; // Fish and level up here.
bool gInForest = false; // Hunt and level up here.
bool gInBushes = false; // pick wild fruits and veggies
bool gInLabyrinth = false; // Have the option of running from minotaurs and other enemies here.
bool gInColosseum = false;
bool gNewGame = true;
bool gDone = false; // For exiting completely

// The main part of this file. This is used at all times to decipher where you want to go. simple at first, then more complex
// Very modular in design
// taking arguments later on when this is post-hummus
void interpret()
{
	while(!gIsGameOver)
	{
		while(gInTown)
		{
			px.clrscr();

			// Set the right location
			gInMainMenu = false;
			gInLabyrinth = false;
			gInForest = false;
			gInBoat = false;
			gInColosseum = false;
			gInBushes = false;
			gInTown = true;

			px.text("Welcome to our bustling town. We have a joyful blacksmith, a great");
			px.text("armor smith, a wicked witch who has all your devilish needs, and a sly");
			px.text("old thief that has all your dirty goods. We have a bloody arena with\nplenty of raving fans",false);
			px.text("We also have a local market downtown, but only the best");
			px.text("warriors get down there. You can buy and sell unique goods down there also.");

			px.text("b.\t(B)blacksmith\ns.\tArmor(s)mith");
			px.text("w.\t(W)itchs Hut\nt.\t(T)hief Alley");
			px.text("a.\tGo to the (a)rena");
			px.text("f.\tGo (f)ishing\nc.\t(C)atch wild game");
			px.text("r.\tGo fo(r)age for wild nuts and berries");

			//if you are level 2 you can go downtown to the market M for market

			//if level 3 you can fight the minotaurs in the labyrith L for labyrinth

			//if level 5 you can start a bank  // K for bank

			// add more stuff

			px.text("h.\t(H)elp\nx.\tE(x)it");
			gString.clear();
			px.getS(gString, "Where would you like  go > ");

			const char *cTemp = gString.c_str();

			switch(*cTemp)
			{
			case 'b':
			case 'B':
				weaponShop(); // Blacksmith
				break;

			case 's':
			case 'S':
				armorShop(); // Armorsmith
				break;

			case 'w':
			case 'W':
				magicShop(); // Witch hut
				break;

			case 't':
			case 'T':
				thiefShop(); // Thiefs alley
				break;

			case 'a':
			case 'A':
				gInColosseum = true;
				Arena(); // Arena
				break;
			case 'm':
			case 'M':
				//Check level 2 first
				//  Market(); // Market
				break;
			case 'f':
			case 'F':
				gInBoat = true;
				Fishing();
				break;
			case 'c':
			case 'C':	//(c)atch wild game
				gInForest = true;
				Hunting();
				break;

			case 'h':
			case 'H': // help
				townMenuHelp();
				break;
			case 'r':
			case 'R':
				gInBushes = true;
				Vegitation();
				break;
			case 'x':
			case 'X':
			case 'exit': // exit
				gDone=true;
				gInTown=false;
				gIsGameOver=true;
				gInMainMenu=true;
				break;

			default:
				px.pause("Please put in a valid choice.");
				break;

			}
		}
		while(gInLabyrinth) // toying with death lmao
		{

		}
		while(gInForest) // Hunting
		{
			Hunting();
			/* Display menu here */

		}
		while(gInBoat) // Fishing
		{
			Fishing();
		}
		while(gInBushes)
		{
			Vegitation();
		}
		gInLabyrinth = false;
		gInForest = false; // hunting wild game
		gInColosseum = false; // arena
		gInTown = false;
		gInMainMenu = true;
		gInBushes = false; // Collecting berries

		/*Showing the main menu*/
	}
}

void townMenuHelp() {}

void magicMenuHelp() {}
void thiefMenuHelp() {}
void weaponMenuHelp() {}
void armorMenuHelp() {}

void talkToCommonPeople() {} // for some tips and just to make it more old-school
void talkToGaurds() {} // for finally defeating the minotaur den ???

